export default <T = any>() => {
  const store = reactive({
    show: false,
    id: '' as any,
    info: {} as unknown as T,
    edit: false,
    handleShow: (item: any, edit = false) => {
      store.show = true
      store.id = item.id ?? ''
      store.info = item
      store.edit = edit
    },
    confirm: () => {},
    cancel: () => {
      store.show = false
      store.id = ''
      store.edit = false
      store.info = {} as any
    },
  })
  return { store }
}
